#ifndef BOARD_H
#define BOARD_H

#include <QWidget>
#include"stone.h"
class board : public QWidget
{
    Q_OBJECT
public:
    explicit board(QWidget *parent = nullptr);
    void paintEvent(QPaintEvent *);
    stone _s[32];//定义32颗棋子
    int _r;//棋子的半径
    int _selectid;
    bool _bRedTurn;

    //返回象棋棋盘行列对应的像素坐标
    QPoint center(int _row,int _col);//返回棋盘上棋子的像素坐标
    QPoint center(int id);
    bool getRowCol(QPoint pt,int&row,int&col);

    void drawstone(QPainter&painter, int id);//在棋盘上绘出棋子
    //void paintEvent(QPaintEvent *);
    void mouseReleaseEvent(QMouseEvent *);

    bool canMove(int moveid,int row,int col,int killid);

    bool canMove1(int moveid,int row,int col,int killid);
    bool canMove2(int moveid,int row,int col,int killid);
    bool canMove3(int moveid,int row,int col,int killid);
    bool canMove4(int moveid,int row,int col,int killid);
    bool canMove5(int moveid,int row,int col,int killid);
    bool canMove6(int moveid,int row,int col,int killid);
    bool canMove7(int moveid,int row,int col,int killid);
signals:

public slots:
};

#endif // BOARD_H
